#!/usr/bin/env python
# -*- coding:utf-8 -*-

from flask_restful import Api

from . import userwordtimes_blueprint
from api_1_0.userWordTimesResource.userWordTimesResource import UserWordTimesResource
from api_1_0.userWordTimesResource.userWordTimesOtherResource import UserWordTimesOtherResource

api = Api(userwordtimes_blueprint)

api.add_resource(UserWordTimesResource, '/<user_word_id>', '', endpoint='UserWordTimes')


@userwordtimes_blueprint.route('/update/<user_word_id>', methods=['PUT'], endpoint='UserWordTimesUpdate')
def update(user_word_id):
    return UserWordTimesOtherResource.sensitive_update(user_word_id)


@userwordtimes_blueprint.route('/records', methods=['GET'], endpoint='UserWordTimesRecords')
def get_user_learning_records():
    return UserWordTimesOtherResource.get_user_learning_records()

